package com.demo.core.filter;


import java.util.Optional;

public class RequestContext {
	private static final ThreadLocal<String> USER_ID = new ThreadLocal<String>();

	public static void setUserId(String userId) {
		USER_ID.set(userId);
	}

	public static String getUserId() {
		return Optional.ofNullable(USER_ID.get()).orElse("1");
	}

	public static void clear() {
		USER_ID.remove();
	}
}
